import React, { useState } from 'react';
import {Button, Input, Modal, Segmented} from 'antd';
import MTable from './table';

const App = (props) => {
    const [isModalOpen, setIsModalOpen] = useState(false);
    const showModal = () => {
        setIsModalOpen(true);
    };

    const handleOk = () => {
        setIsModalOpen(false);
    };

    const handleCancel = () => {
        setIsModalOpen(false);
    };

    React.useImperativeHandle(props.onRef, () => {
        return {
            showModal: showModal,
        };
    });
    return (
        <>
            <Modal title="界面参数设置" width={1000} open={isModalOpen} onOk={handleOk} onCancel={handleCancel}>
                <MTable />
                <div style={{marginTop: '20px'}}>
                    <Button>上移</Button>
                    <Button style={{marginLeft: '18px'}}>下移</Button>
                    <Button style={{marginLeft: '18px'}}>恢复缺省</Button>
                </div>
            </Modal>
        </>
    );
};

export default App;
